import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export const store = new Vuex.Store({
	
	strict:true,
	state:{
     	myCar:[],
     	personInfor:[],
     	jieObj:[]
	},
	getters:{

		
	},
	mutations:{
	  pushCarData:(state,GoodsData)=>{
	  		//GoodsData   {id:1,num:2}
	  		state.myCar.push(GoodsData);
	  		console.log(state.myCar)
	  },
	  changeCarData:(state,arr)=>{
	  	state.myCar = arr;
	  },
	  changejieObj:(state,theobj)=>{
	  	var obj = Object.assign({},theobj.data,theobj.num)
	  	state.jieObj=obj;
	  },
	  pushpersonInfor:(state,personInfordata)=>{
	  	state.personInfor.push(personInfordata);
	  
	  },
	  removepersonInfor:(state)=>{
	  	state.personInfor=[];
	  }
	}
})
